// TestNamedPipeLogWriter.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "../NamedPipeLogWriter/NamedPipeLogWriterForC++.h"
#pragma comment(lib, "NamedPipeLogWriter.lib")


#include <ppl.h>
#include <concurrent_queue.h>
#include <agents.h>

int _tmain(int argc, _TCHAR* argv[])
{
	CNamedPipeLogWriter logInstance(_T("\\\\10.10.10.2\\Pipe\\YLogPipe"));
	Concurrency::task_group tasks;

	tasks.run([&](){
		DWORD testCount = 40;
		while(testCount--)
		{
			logInstance.Log(_T("Test Log"));
			Sleep(400);
		}

	});
	
	tasks.run([&](){
		DWORD testCount = 40;
		while(testCount--)
		{ 
			logInstance.AsyncLog(_T("Test AsyncLog"));
			Sleep(400);			
		}

	});

	tasks.wait();
	return 0;
}

